#!/bin/bash
if [ $# != 2 ]; then
	echo "usage: ./run.sh url suffix"
	exit -1;
fi

suffix=$2
wget $1 -O tmp
iconv -f gbk -t utf8 tmp > $suffix.sourcecode
sed -e "s/ \|>/\r\n/g" $suffix.sourcecode | grep 'href' | grep 'http' | sed "s/'\|\"//g" | sed "s/href=//g" | sort -u > sf.list.$suffix
rm tmp
